<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Graduate School Application</title>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" href="../resource/styleCSS.css" /> 	
	<link rel="stylesheet" type="text/css" href="../resource/columnCSS.css" /> 
</head>
<body>
	<% 
		String residence = request.getParameter("residence");
		session.setAttribute("residence", residence);
		session.setAttribute("domestic", true);
			
		String fname = (String)session.getAttribute("fname");
		String lname = (String)session.getAttribute("lname");
		String mname = (String)session.getAttribute("mname");
		String citizen = (String)session.getAttribute("citizen");
	%>
	<div class="container">
	<div class="center_div">
		<div class="colmask threecol">
		<div class="colmid">
		<div class="colleft">
			<div class="bodycol">
				<p>Applicant: <i><%= fname%> <%= mname%> <%= lname%></i></p> 
				<p>Citizenship: <i><%= citizen%></i></p>
				<p>Country of Residence: <i><%= residence%></i></p>
				<br>
						
				<p><b>Enter Address</b></p>
			</div>
			<div class="sidecol">
				<p><a href="../invalidate.jsp">Logout</a></p>
			</div>
		</div>
		</div>
		</div>
		<div style="clear:both;"></div>			
		<% 
			if(residence.equals("United States")) {
				out.println("<form method=\"GET\" action=\"degreesChooseLocationJSP.jsp\">");
			}
			else
			{
				out.println("<form method=\"GET\" action=\"residencyJSP.jsp\">");	   	   
			}
		%>	
			   	
		<form method="GET" action="residencyJSP.jsp">
			<ul class="none">
			<li>Street Address: <input type="text" size="30" name="address"/> </li>
			<li>City: <input type="text" name="city"/>
				<% 
					if(residence.equals("United States")) {
				   		out.println("State:");
				   		out.println("<input type=\"text\" size=\"1\" name=\"state\"/>");
				 	}
				%>
				Zip Code: <input type="text" size="4" name="zipcode"/> </li>
				<% 
					if(!residence.equals("United States")) {
				   		out.println("<li>Country Telephone Code:");
				   		out.println("<input type=\"text\" size=\"3\" name=\"countrycode\"/></li>");
				 	}
				%>
			<li>Area Code: <input type="text" size="1" name="areacode"/>
				Number: <input type="text" size="6" name="number"/> </li>
			</ul>
			<input type="submit" value="Submit"/>
		</form>
	</div>
	</div>
</body>
</html>